package com.bajiao.vo.store;

import com.alibaba.fastjson.annotation.JSONField;
import com.bajiao.common.util.FastJsonHelper;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Data
@ApiModel("StoreStatResponse")
public class StoreStatResponse {

    @ApiModelProperty("今日核销面额")
    private String todayAmount;

    @ApiModelProperty("今日核销券数量")
    private Long todayNum;

    @ApiModelProperty("昨日核销面额")
    private String yesterdayAmount;

    @ApiModelProperty("昨日核销券数量")
    private Long yesterdayNum;

    @ApiModelProperty("仅七天营业额")
    private List<StoreRecentDays> recentDaysList;

    @ApiModelProperty("本月核销面额")
    private String thisMonthAmount;

    @ApiModelProperty("本月核销券数量")
    private Long thisMonthNum;

    @ApiModelProperty("上月核销面额")
    private String lastMonthAmount;

    @ApiModelProperty("上月核销券数量")
    private Long lastMonthNum;

    public StoreStatResponse(BigDecimal todayAmount, Long todayNum,
                             BigDecimal yesterdayAmount, Long yesterdayNum,
                             List<StoreRecentDays> recentDaysList,
                             BigDecimal thisMonthAmount, Long thisMonthNum,
                             BigDecimal lastMonthAmount, Long lastMonthNum){
        this.todayAmount = todayAmount.stripTrailingZeros().toPlainString();
        this.todayNum = todayNum;
        this.yesterdayAmount = yesterdayAmount.stripTrailingZeros().toPlainString();
        this.yesterdayNum = yesterdayNum;
        recentDaysList.forEach(i -> i.setAmountStr(i.getAmount().stripTrailingZeros().toPlainString()));
        this.recentDaysList = recentDaysList;
        this.thisMonthAmount = thisMonthAmount.stripTrailingZeros().toPlainString();
        this.thisMonthNum = thisMonthNum;
        this.lastMonthAmount = lastMonthAmount.stripTrailingZeros().toPlainString();
        this.lastMonthNum = lastMonthNum;
    }
}
